#ifndef DEBUG_H_
#define DEBUG_H_

#include <windows.h>

#ifdef ASSERT
#undef ASSERT
#endif 

#ifdef TRACE
#   define  dbgtrace dbgprint(__FUNCTION__);
#else
#   define  dbgtrace
#endif 


#ifdef _DEBUG

#if 1
#define dbgprint printf
#else
// Prints a message to the debugger
void 
dbgprint(
        const char *format,
        ...
        );

#define ASSERT(exp)                                             \
        if ( !(exp) )                                           \
            dbgprint("\n*** Assertion failed: %s\n"              \
                       "***      Source file: %s, line: %d\n\n", \
                       #exp,__FILE__,__LINE__), DebugBreak()
#endif

#else //_DEBUG

// On free builds, define these to be empty
#define ASSERT(exp)
#define dbgprint

#endif //_DEBUG


#endif //DEBUG_H_